﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGsView : OdRxObject
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGsView(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGsView_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGsView obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGsView()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGsView(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdGsView cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGsView_cast(OdRxObject.getCPtr(pObj));
			OdGsView result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGsView)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGsView)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGsView)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGsView_desc(), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGsView_isA(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGsView_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static OdGsView createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGsView_createObject();
			OdGsView result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGsView)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGsView)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGsView)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGsDevice device()
		{
			OdGsDevice result = (OdGsDevice)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGsView_device(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiContext userGiContext()
		{
			OdGiContext result = (OdGiContext)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGsView_userGiContext(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setUserGiContext(OdGiContext pUserGiContext)
		{
			GlobalsPINVOKE.OdGsView_setUserGiContext(this.swigCPtr, OdGiContext.getCPtr(pUserGiContext));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double lineweightToDcScale()
		{
			double result = GlobalsPINVOKE.OdGsView_lineweightToDcScale(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setLineweightToDcScale(double scale)
		{
			GlobalsPINVOKE.OdGsView_setLineweightToDcScale(this.swigCPtr, scale);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setLineweightEnum(byte[] numLineweights)
		{
			IntPtr intPtr = Teigha.Core.Helpers.MarshalbyteFixedArray(numLineweights);
			try
			{
				GlobalsPINVOKE.OdGsView_setLineweightEnum(this.swigCPtr, intPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				Marshal.FreeCoTaskMem(intPtr);
			}
		}

		public virtual void setViewport(OdGePoint2d lowerLeft, OdGePoint2d upperRight)
		{
			GlobalsPINVOKE.OdGsView_setViewport__SWIG_0(this.swigCPtr, OdGePoint2d.getCPtr(lowerLeft), OdGePoint2d.getCPtr(upperRight));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setViewport(OdGsDCRect screenRect)
		{
			GlobalsPINVOKE.OdGsView_setViewport__SWIG_1(this.swigCPtr, OdGsDCRect.getCPtr(screenRect));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setViewport(OdGsDCRectDouble screenRect)
		{
			GlobalsPINVOKE.OdGsView_setViewport__SWIG_2(this.swigCPtr, OdGsDCRectDouble.getCPtr(screenRect));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void getViewport(OdGePoint2d lowerLeft, OdGePoint2d upperRight)
		{
			GlobalsPINVOKE.OdGsView_getViewport__SWIG_0(this.swigCPtr, OdGePoint2d.getCPtr(lowerLeft), OdGePoint2d.getCPtr(upperRight));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void getViewport(OdGsDCRect screenRect)
		{
			GlobalsPINVOKE.OdGsView_getViewport__SWIG_1(this.swigCPtr, OdGsDCRect.getCPtr(screenRect));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void getViewport(OdGsDCRectDouble screenRect)
		{
			GlobalsPINVOKE.OdGsView_getViewport__SWIG_2(this.swigCPtr, OdGsDCRectDouble.getCPtr(screenRect));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setViewportClipRegion(int numContours, SWIGTYPE_p_int numVertices, OdGsDCPoint vertices)
		{
			GlobalsPINVOKE.OdGsView_setViewportClipRegion__SWIG_0(this.swigCPtr, numContours, SWIGTYPE_p_int.getCPtr(numVertices), OdGsDCPoint.getCPtr(vertices));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setViewportClipRegion(OdGePoint2dArray[] numContours)
		{
			IntPtr intPtr = Helpers.MarshalClipRegion(numContours);
			try
			{
				GlobalsPINVOKE.OdGsView_setViewportClipRegion__SWIG_1(this.swigCPtr, intPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				Marshal.FreeCoTaskMem(intPtr);
			}
		}

		public virtual void viewportClipRegion(OdIntArray counts, OdGsDCPointArray vertices)
		{
			GlobalsPINVOKE.OdGsView_viewportClipRegion__SWIG_0(this.swigCPtr, OdIntArray.getCPtr(counts).Handle, OdGsDCPointArray.getCPtr(vertices));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void viewportClipRegion(OdIntArray counts, OdGePoint2dArray vertices)
		{
			GlobalsPINVOKE.OdGsView_viewportClipRegion__SWIG_1(this.swigCPtr, OdIntArray.getCPtr(counts).Handle, OdGePoint2dArray.getCPtr(vertices).Handle);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void removeViewportClipRegion()
		{
			GlobalsPINVOKE.OdGsView_removeViewportClipRegion(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setViewport3dClipping(OdGiClipBoundary pBoundary, OdGiAbstractClipBoundary pClipInfo)
		{
			GlobalsPINVOKE.OdGsView_setViewport3dClipping__SWIG_0(this.swigCPtr, OdGiClipBoundary.getCPtr(pBoundary), OdGiAbstractClipBoundary.getCPtr(pClipInfo));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setViewport3dClipping(OdGiClipBoundary pBoundary)
		{
			GlobalsPINVOKE.OdGsView_setViewport3dClipping__SWIG_1(this.swigCPtr, OdGiClipBoundary.getCPtr(pBoundary));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGiClipBoundary viewport3dClipping(SWIGTYPE_p_p_OdGiAbstractClipBoundary ppClipInfo)
		{
			IntPtr intPtr = GlobalsPINVOKE.OdGsView_viewport3dClipping__SWIG_0(this.swigCPtr, SWIGTYPE_p_p_OdGiAbstractClipBoundary.getCPtr(ppClipInfo));
			OdGiClipBoundary result = (intPtr == IntPtr.Zero) ? null : new OdGiClipBoundary(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiClipBoundary viewport3dClipping()
		{
			IntPtr intPtr = GlobalsPINVOKE.OdGsView_viewport3dClipping__SWIG_1(this.swigCPtr);
			OdGiClipBoundary result = (intPtr == IntPtr.Zero) ? null : new OdGiClipBoundary(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void removeViewport3dClipping()
		{
			GlobalsPINVOKE.OdGsView_removeViewport3dClipping(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setViewportBorderProperties(uint color, int width)
		{
			GlobalsPINVOKE.OdGsView_setViewportBorderProperties(this.swigCPtr, color, width);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void getViewportBorderProperties(out uint color, out int width)
		{
			GlobalsPINVOKE.OdGsView_getViewportBorderProperties(this.swigCPtr, out color, out width);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setViewportBorderVisibility(bool visible)
		{
			GlobalsPINVOKE.OdGsView_setViewportBorderVisibility(this.swigCPtr, visible);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isViewportBorderVisible()
		{
			bool result = GlobalsPINVOKE.OdGsView_isViewportBorderVisible(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setView(OdGePoint3d position, OdGePoint3d target, OdGeVector3d upVector, double fieldWidth, double fieldHeight, OdGsView.Projection projectionType)
		{
			GlobalsPINVOKE.OdGsView_setView__SWIG_0(this.swigCPtr, OdGePoint3d.getCPtr(position), OdGePoint3d.getCPtr(target), OdGeVector3d.getCPtr(upVector), fieldWidth, fieldHeight, (int)projectionType);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setView(OdGePoint3d position, OdGePoint3d target, OdGeVector3d upVector, double fieldWidth, double fieldHeight)
		{
			GlobalsPINVOKE.OdGsView_setView__SWIG_1(this.swigCPtr, OdGePoint3d.getCPtr(position), OdGePoint3d.getCPtr(target), OdGeVector3d.getCPtr(upVector), fieldWidth, fieldHeight);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGePoint3d position()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGsView_position(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGePoint3d target()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGsView_target(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGeVector3d upVector()
		{
			OdGeVector3d result = new OdGeVector3d(GlobalsPINVOKE.OdGsView_upVector(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual double lensLength()
		{
			double result = GlobalsPINVOKE.OdGsView_lensLength(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setLensLength(double lensLength)
		{
			GlobalsPINVOKE.OdGsView_setLensLength(this.swigCPtr, lensLength);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isPerspective()
		{
			bool result = GlobalsPINVOKE.OdGsView_isPerspective(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual double fieldWidth()
		{
			double result = GlobalsPINVOKE.OdGsView_fieldWidth(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual double fieldHeight()
		{
			double result = GlobalsPINVOKE.OdGsView_fieldHeight(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setEnableFrontClip(bool enable)
		{
			GlobalsPINVOKE.OdGsView_setEnableFrontClip(this.swigCPtr, enable);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isFrontClipped()
		{
			bool result = GlobalsPINVOKE.OdGsView_isFrontClipped(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setFrontClip(double frontClip)
		{
			GlobalsPINVOKE.OdGsView_setFrontClip(this.swigCPtr, frontClip);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double frontClip()
		{
			double result = GlobalsPINVOKE.OdGsView_frontClip(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setEnableBackClip(bool enable)
		{
			GlobalsPINVOKE.OdGsView_setEnableBackClip(this.swigCPtr, enable);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isBackClipped()
		{
			bool result = GlobalsPINVOKE.OdGsView_isBackClipped(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setBackClip(double backClip)
		{
			GlobalsPINVOKE.OdGsView_setBackClip(this.swigCPtr, backClip);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double backClip()
		{
			double result = GlobalsPINVOKE.OdGsView_backClip(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGeMatrix3d viewingMatrix()
		{
			OdGeMatrix3d result = new OdGeMatrix3d(GlobalsPINVOKE.OdGsView_viewingMatrix(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGeMatrix3d projectionMatrix()
		{
			OdGeMatrix3d result = new OdGeMatrix3d(GlobalsPINVOKE.OdGsView_projectionMatrix(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGeMatrix3d screenMatrix()
		{
			OdGeMatrix3d result = new OdGeMatrix3d(GlobalsPINVOKE.OdGsView_screenMatrix(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGeMatrix3d worldToDeviceMatrix()
		{
			OdGeMatrix3d result = new OdGeMatrix3d(GlobalsPINVOKE.OdGsView_worldToDeviceMatrix(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGeMatrix3d objectToDeviceMatrix()
		{
			OdGeMatrix3d result = new OdGeMatrix3d(GlobalsPINVOKE.OdGsView_objectToDeviceMatrix(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setMode(OdGsView.RenderMode mode)
		{
			GlobalsPINVOKE.OdGsView_setMode(this.swigCPtr, (int)mode);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGsView.RenderMode mode()
		{
			OdGsView.RenderMode result = (OdGsView.RenderMode)GlobalsPINVOKE.OdGsView_mode(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool add(OdGiDrawable pSceneGraph, OdGsModel pModel)
		{
			bool result = GlobalsPINVOKE.OdGsView_add(this.swigCPtr, OdGiDrawable.getCPtr(pSceneGraph), OdGsModel.getCPtr(pModel));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool erase(OdGiDrawable sceneGraph)
		{
			bool result = GlobalsPINVOKE.OdGsView_erase(this.swigCPtr, OdGiDrawable.getCPtr(sceneGraph));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void eraseAll()
		{
			GlobalsPINVOKE.OdGsView_eraseAll(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGsModel getModel(OdGiDrawable pDrawable)
		{
			OdGsModel result = (OdGsModel)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGsView_getModel(this.swigCPtr, OdGiDrawable.getCPtr(pDrawable)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual SWIGTYPE_p_OdArrayT_OdGsModel_p_OdMemoryAllocatorT_OdGsModel_p_t_t getModelList()
		{
			SWIGTYPE_p_OdArrayT_OdGsModel_p_OdMemoryAllocatorT_OdGsModel_p_t_t result = new SWIGTYPE_p_OdArrayT_OdGsModel_p_OdMemoryAllocatorT_OdGsModel_p_t_t(GlobalsPINVOKE.OdGsView_getModelList(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void invalidate()
		{
			GlobalsPINVOKE.OdGsView_invalidate__SWIG_0(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void invalidate(OdGsDCRect screenRect)
		{
			GlobalsPINVOKE.OdGsView_invalidate__SWIG_1(this.swigCPtr, OdGsDCRect.getCPtr(screenRect));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isValid()
		{
			bool result = GlobalsPINVOKE.OdGsView_isValid(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void update()
		{
			GlobalsPINVOKE.OdGsView_update(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void beginInteractivity(double frameRateInHz)
		{
			GlobalsPINVOKE.OdGsView_beginInteractivity(this.swigCPtr, frameRateInHz);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void endInteractivity()
		{
			GlobalsPINVOKE.OdGsView_endInteractivity(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void flush()
		{
			GlobalsPINVOKE.OdGsView_flush(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void hide()
		{
			GlobalsPINVOKE.OdGsView_hide(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void show()
		{
			GlobalsPINVOKE.OdGsView_show(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isVisible()
		{
			bool result = GlobalsPINVOKE.OdGsView_isVisible(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void freezeLayer(OdDbStub layerID)
		{
			GlobalsPINVOKE.OdGsView_freezeLayer(this.swigCPtr, OdDbStub.getCPtr(layerID));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void thawLayer(OdDbStub layerID)
		{
			GlobalsPINVOKE.OdGsView_thawLayer(this.swigCPtr, OdDbStub.getCPtr(layerID));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void clearFrozenLayers()
		{
			GlobalsPINVOKE.OdGsView_clearFrozenLayers(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void invalidateCachedViewportGeometry()
		{
			GlobalsPINVOKE.OdGsView_invalidateCachedViewportGeometry(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void select(OdGsDCPoint[] pts, OdGsSelectionReactor pReactor, OdGsView.SelectionMode mode)
		{
			IntPtr intPtr = Helpers.MarshalOdGsDCPointArray(pts);
			try
			{
				GlobalsPINVOKE.OdGsView_select(this.swigCPtr, intPtr, OdGsSelectionReactor.getCPtr(pReactor), (int)mode);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				Marshal.FreeCoTaskMem(intPtr);
			}
		}

		public virtual void dolly(OdGeVector3d dollyVector)
		{
			GlobalsPINVOKE.OdGsView_dolly__SWIG_0(this.swigCPtr, OdGeVector3d.getCPtr(dollyVector));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void dolly(double xDolly, double yDolly, double zDolly)
		{
			GlobalsPINVOKE.OdGsView_dolly__SWIG_1(this.swigCPtr, xDolly, yDolly, zDolly);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void roll(double rollAngle)
		{
			GlobalsPINVOKE.OdGsView_roll(this.swigCPtr, rollAngle);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void orbit(double xOrbit, double yOrbit)
		{
			GlobalsPINVOKE.OdGsView_orbit(this.swigCPtr, xOrbit, yOrbit);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void zoom(double zoomFactor)
		{
			GlobalsPINVOKE.OdGsView_zoom(this.swigCPtr, zoomFactor);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void pan(double xPan, double yPan)
		{
			GlobalsPINVOKE.OdGsView_pan(this.swigCPtr, xPan, yPan);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void zoomExtents(OdGePoint3d minPt, OdGePoint3d maxPt)
		{
			GlobalsPINVOKE.OdGsView_zoomExtents(this.swigCPtr, OdGePoint3d.getCPtr(minPt), OdGePoint3d.getCPtr(maxPt));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void zoomWindow(OdGePoint2d lowerLeft, OdGePoint2d upperRight)
		{
			GlobalsPINVOKE.OdGsView_zoomWindow(this.swigCPtr, OdGePoint2d.getCPtr(lowerLeft), OdGePoint2d.getCPtr(upperRight));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool pointInView(OdGePoint3d pt)
		{
			bool result = GlobalsPINVOKE.OdGsView_pointInView(this.swigCPtr, OdGePoint3d.getCPtr(pt));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool extentsInView(OdGePoint3d minPt, OdGePoint3d maxPt)
		{
			bool result = GlobalsPINVOKE.OdGsView_extentsInView(this.swigCPtr, OdGePoint3d.getCPtr(minPt), OdGePoint3d.getCPtr(maxPt));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGsView cloneView(bool cloneViewParameters, bool cloneGeometry)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGsView_cloneView__SWIG_0(this.swigCPtr, cloneViewParameters, cloneGeometry);
			OdGsView result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGsView)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGsView)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGsView)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGsView cloneView(bool cloneViewParameters)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGsView_cloneView__SWIG_1(this.swigCPtr, cloneViewParameters);
			OdGsView result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGsView)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGsView)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGsView)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGsView cloneView()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGsView_cloneView__SWIG_2(this.swigCPtr);
			OdGsView result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGsView)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGsView)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGsView)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void viewParameters(OdGsView pView)
		{
			GlobalsPINVOKE.OdGsView_viewParameters(this.swigCPtr, OdGsView.getCPtr(pView));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool exceededBounds()
		{
			bool result = GlobalsPINVOKE.OdGsView_exceededBounds(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void enableStereo(bool enabled)
		{
			GlobalsPINVOKE.OdGsView_enableStereo(this.swigCPtr, enabled);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isStereoEnabled()
		{
			bool result = GlobalsPINVOKE.OdGsView_isStereoEnabled(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setStereoParameters(double magnitude, double parallax)
		{
			GlobalsPINVOKE.OdGsView_setStereoParameters(this.swigCPtr, magnitude, parallax);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void getStereoParameters(out double magnitude, out double parallax)
		{
			GlobalsPINVOKE.OdGsView_getStereoParameters(this.swigCPtr, out magnitude, out parallax);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void initLights(OdRxIterator pLightsIterator)
		{
			GlobalsPINVOKE.OdGsView_initLights(this.swigCPtr, OdRxIterator.getCPtr(pLightsIterator));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setLinetypeScaleMultiplier(double linetypeScaleMultiplier)
		{
			GlobalsPINVOKE.OdGsView_setLinetypeScaleMultiplier(this.swigCPtr, linetypeScaleMultiplier);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double linetypeScaleMultiplier()
		{
			double result = GlobalsPINVOKE.OdGsView_linetypeScaleMultiplier(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setAlternateLinetypeScaleMultiplier(double linetypeAlternateScaleMultiplier)
		{
			GlobalsPINVOKE.OdGsView_setAlternateLinetypeScaleMultiplier(this.swigCPtr, linetypeAlternateScaleMultiplier);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double linetypeAlternateScaleMultiplier()
		{
			double result = GlobalsPINVOKE.OdGsView_linetypeAlternateScaleMultiplier(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void clientViewInfo(OdGsClientViewInfo clientViewInfo)
		{
			GlobalsPINVOKE.OdGsView_clientViewInfo(this.swigCPtr, OdGsClientViewInfo.getCPtr(clientViewInfo));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setClearColor(OdGsView.ClearColor color)
		{
			GlobalsPINVOKE.OdGsView_setClearColor(this.swigCPtr, (int)color);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool pointInViewport(OdGePoint2d screenPoint)
		{
			bool result = GlobalsPINVOKE.OdGsView_pointInViewport(this.swigCPtr, OdGePoint2d.getCPtr(screenPoint));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void getNumPixelsInUnitSquare(OdGePoint3d point, OdGePoint2d pixelDensity, bool bUsePerspective)
		{
			GlobalsPINVOKE.OdGsView_getNumPixelsInUnitSquare__SWIG_0(this.swigCPtr, OdGePoint3d.getCPtr(point), OdGePoint2d.getCPtr(pixelDensity), bUsePerspective);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void getNumPixelsInUnitSquare(OdGePoint3d point, OdGePoint2d pixelDensity)
		{
			GlobalsPINVOKE.OdGsView_getNumPixelsInUnitSquare__SWIG_1(this.swigCPtr, OdGePoint3d.getCPtr(point), OdGePoint2d.getCPtr(pixelDensity));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setBackground(OdDbStub backgroundId)
		{
			GlobalsPINVOKE.OdGsView_setBackground(this.swigCPtr, OdDbStub.getCPtr(backgroundId));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdDbStub background()
		{
			IntPtr intPtr = GlobalsPINVOKE.OdGsView_background(this.swigCPtr);
			OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setVisualStyle(OdDbStub visualStyleId)
		{
			GlobalsPINVOKE.OdGsView_setVisualStyle__SWIG_0(this.swigCPtr, OdDbStub.getCPtr(visualStyleId));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdDbStub visualStyle()
		{
			IntPtr intPtr = GlobalsPINVOKE.OdGsView_visualStyle__SWIG_0(this.swigCPtr);
			OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setVisualStyle(OdGiVisualStyle visualStyle)
		{
			GlobalsPINVOKE.OdGsView_setVisualStyle__SWIG_1(this.swigCPtr, OdGiVisualStyle.getCPtr(visualStyle));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool visualStyle(OdGiVisualStyle visualStyle)
		{
			bool result = GlobalsPINVOKE.OdGsView_visualStyle__SWIG_1(this.swigCPtr, OdGiVisualStyle.getCPtr(visualStyle));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void getSnapShot(out OdGiRasterImage pImage, OdGsDCRect region)
		{
			IntPtr zero = IntPtr.Zero;
			try
			{
				GlobalsPINVOKE.OdGsView_getSnapShot(this.swigCPtr, out zero, OdGsDCRect.getCPtr(region));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				pImage = (OdGiRasterImage)Teigha.Core.Helpers.odrxCreateObjectInternal(zero, true);
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		public enum RenderMode
		{
			kBoundingBox = -1,
			k2DOptimized,
			kWireframe,
			kHiddenLine,
			kFlatShaded,
			kGouraudShaded,
			kFlatShadedWithWireframe,
			kGouraudShadedWithWireframe,
			kNone
		}

		public enum Projection
		{
			kParallel,
			kPerspective
		}

		public enum SelectionMode
		{
			kWindow,
			kCrossing,
			kFence,
			kWPoly,
			kCPoly,
			kPoint = 16
		}

		public enum ClearColor
		{
			kTransparent,
			kDeviceBackground,
			kPaletteBackground
		}
	}
}
